package com.pz.cloud.framework.business.workflow.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.pz.cloud.framework.base.annotation.Select;
import com.pz.cloud.framework.base.model.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.Date;

/**
 * 待办主表
 * @author mazezhan
 */
@TableName(value = "oa_wait_done")
@Data
@ApiModel(value = "oa_wait_done对象", description = "待办表")
public class WaitDone extends BaseEntity {

    /**
     * 主键
     */
    @TableId(type = IdType.ASSIGN_UUID)
    @ApiModelProperty(hidden = true)
    private String id;
    /**
     * 上一步任务id
     */
    @ApiModelProperty(hidden = true)
    private String parentId;
    /**
     * 任务key
     */
    @ApiModelProperty(hidden = true)
    private String taskKey;

    /**
     * 任务名称,activiti的名称
     */
    @ApiModelProperty(value = "任务名称")
    private String taskName;

    /**
     * 来源 activiti 工作流 notice 通知
     */
    @ApiModelProperty(value = "来源 activiti 工作流 notice 通知")
    private String source;

    /**
     * 关联业务表主键
     */
    @ApiModelProperty
    private String bizId;

    /**
     * 流程实例ID--activiti唯一标识
     */
    @ApiModelProperty(hidden = true)
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String processInstanceId;

    /**
     * 处理状态 0未处理  1已处理
     */
    @ApiModelProperty(value = " 处理状态 0未处理  1已处理")
    private Integer status;
    /**
     * 处理时间
     */
    @ApiModelProperty(hidden = true)
    private Date dealTime;
    /**
     * 处理人id
     */
    @ApiModelProperty(hidden = true)
    @Select(expression = "deal_user_id = :dealUserId")
    private String dealUserId;
    /**
     * 处理人名称
     */
    @ApiModelProperty(value = "处理人名称")
    private String dealUserName;

    /**
     * 审批意见
     */
    @ApiModelProperty(hidden = true)
    private String opinion;

    /**
     * 审批结果
     */
    @ApiModelProperty(hidden = true)
    private String result;
    /**
     * 到期时间
     */
    @ApiModelProperty(value = "到期时间")
    private Date dueDate;

    @TableField(exist = false)//标题
    @ApiModelProperty(value = "标题")
    private String title;

    @TableField(exist = false)//标题
    @ApiModelProperty(value = "业务处理页面url")
    private String bizUrl;


    @TableField(exist = false)//待处理人
    @ApiModelProperty(value = "待处理人")
    private String waitUserName;
    @TableField(exist = false)//待处理人
    @ApiModelProperty(value = "待处理人id")
    private String waitUserId;

    @TableField(exist = false)//标记是否能撤回
    @ApiModelProperty(value = "标记是否能撤回 1是 0否")
    private Integer withdrawFlag;

    @ApiModelProperty(value = " 超时状态 0未超时  1已超时")
    @TableField(exist = false)
    private Integer timeOutFlag;

}
